package org.finesys.common.disruptor.event;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.EventObject;

@Getter
@Setter
public class DisruptorEvent extends EventObject {

    /**
     * 事件名
     */
    private String event;

    /**
     * Event Tag
     */
    private String tag;
    /**
     * Event Keys
     */
    private String key;
    /**
     * 消息级别
     */
    private int grade;
    /**
     * 发生时间
     */
    private Date messageTime;
    /**
     * 对象实体数据
     */
    private Object body;

    public DisruptorEvent(Object source) {
        super(source);
    }


    public String getRouteExpression() {
        return new StringBuilder("/").append(getEvent()).append("/").append(getTag()).append("/")
                .append(getKey()).toString();
    }
}
